<div>
  <span id="project_entry_form"></span>
  <div class="hidden">
    <%= image_tag "result_symbol_check.png", id: "result_symbol_check_img", size: "40x40" %>
    <%= image_tag "result_symbol_x.png", id: "result_symbol_x_img", size: "40x40" %>
    <%= image_tag "result_symbol_dash.png", id: "result_symbol_dash", size: "40x40" %>
    <%= image_tag "result_symbol_question.png", id: "result_symbol_question", size: "40x40" %>
  </div>
</div>
<p class="no-padding padding-right main-subtext">
<%=t('projects.form_early.badge_intro.description') %>

<%= render(partial: "details", locals: {
           criterion: "badge_intro",
           details: t('projects.form_early.badge_intro.details_html')
}) %>

<% if view_only %>
  <% next_level_prefix = project_path %>
  <%= t('projects.form_early.got_badge.description_1') %>
  <!-- DO NOT USE /badge_static in README files! --><img src='<%=
  project.badge_src_url %>' width='<%=
  Badge::BADGE_WIDTHS[project.badge_level]
  %>' height='20' alt="<%=
  t('projects.form_early.got_badge.badge_alt',
    id: project.id, level: project.badge_level) %>">
  <%= t('projects.form_early.got_badge.description_2') %>
  <%= render(partial: "details", locals: {
         criterion: "got_badge",
         details: t('projects.form_early.got_badge.details_html',
                    markdown_embedding: %{<code>[![OpenSSF Best Practices](https://#{ badge_hostname }/projects/#{ project.id }/badge)](https://#{ badge_hostname }/projects/#{ project.id })</code>}.html_safe,
                    html_embedding: %{<code>&lt;a href="https://#{badge_hostname}/projects/#{ project.id }"&gt;&lt;img src="https://#{ badge_hostname }/projects/#{ project.id }/badge"&gt;&lt;/a&gt; </code>}.html_safe)
      }) %>
<% else %>
  <% next_level_prefix = edit_project_path %>
  <%= t('projects.form_early.got_badge.editing_description_html') %>
<% end %>

<br><br>
<%
  # Generate path-based URLs for badge levels (not query parameters)
  # Rails auto-generates level_project_path and level_edit_project_path from routes
  passing_path = view_only ? level_project_path(project, 'passing') : level_edit_project_path(project, 'passing')
  silver_path = view_only ? level_project_path(project, 'silver') : level_edit_project_path(project, 'silver')
  gold_path = view_only ? level_project_path(project, 'gold') : level_edit_project_path(project, 'gold')
%>
<%= t("#{criteria_level}_html", scope: 'projects.form_early.level',
      passing: %{<a href='#{passing_path}' title='#{t('projects.form_early.level.0')}'>#{image_tag('passing.svg', size: '53x20', alt: t('projects.form_early.level.0'))}</a>}.html_safe,
      silver: %{<a href='#{silver_path}' title='#{t('projects.form_early.level.1')}'>#{image_tag('silver.svg', size: '41x20', alt: t('projects.form_early.level.1'))}</a>}.html_safe,
      gold: %{<a href='#{gold_path}' title='#{t('projects.form_early.level.2')}'>#{image_tag('gold.svg', size: '35x20', alt: t('projects.form_early.level.2'))}</a>}.html_safe,
      ) %>

<%# End column started outside. %>
</div>

<div class="col-sm-3">
</div>
<%# end row started outside: %>
</div>

<div class="row">
   <div class="col-md-12">
     <div class="hidden-print">
         <br>
         <%# This is a terrible way to "move to right" but it works.
             Improvements welcome. %>
         &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
         <%# We use btn-primary to ensure these buttons are clearly seen. %>
         <button id="toggle-expand-all-panels"
                 class="btn btn-primary btn-xs btn-stack"
                 title="<%= t 'projects.misc.in_javascript.expand_all_title' %>"
                 type="button"><%= t 'projects.misc.in_javascript.expand_all' %></button>
         <button id="toggle-show-all-details"
                 class="btn btn-primary btn-xs btn-stack"
                 title="<%= t 'projects.misc.in_javascript.show_all_details' %>"
                 type="button"><%= t 'projects.misc.in_javascript.show_all_details' %></button>
         <button id="toggle-hide-metna-criteria"
                 class="btn btn-primary btn-xs btn-stack"
                 title="<%= t 'projects.misc.in_javascript.hide_met_title' %>"
                 type="button"><%= t 'projects.misc.in_javascript.hide_met_html' %></button>
     </div>
   </div>
</div>
